package com.learner.major.controller;

import com.learner.major.service.LwService;
import com.learner.pojo.major.ProgramVoiceRank;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
/**
 * @author ice2020x
 */
@RestController
@RequestMapping("/api/major/lw")
public class LanguageWasController {

    @Autowired
    LwService lwService;

    /**
     * 获取编程排行榜信息
     *
     * @return 列表
     */
    @GetMapping("/getAll")
    public List<ProgramVoiceRank> getAll(){
        return lwService.getAll();
    }

    @PostMapping("/save")
    public ProgramVoiceRank save(@RequestBody  ProgramVoiceRank programVoiceRank){
        return lwService.save(programVoiceRank);
    }

}
